package com.zhuss.order.order;

import com.zhuss.bean.bo.order.order.SearchOrderItemBo;
import com.zhuss.order.processor.OrderItemRead;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import com.zhuss.bean.bo.order.order.DetailOrderBo;
import com.zhuss.bean.bo.order.order.SearchOrderBo;
import com.zhuss.common.ReadService;
import com.zhuss.order.processor.OrderRead;
import com.zhuss.exception.DzcxException;

/**
 * @description: 订单查询Service
 * @author: zhushanshuo
 * @create: Mon Jan 11 10:24:29 CST 2021
 **/
@Component("orderReadService")
public class OrderReadService implements ReadService<Object, Object> {

	@Autowired
	@Qualifier("orderRead")
	private OrderRead orderRead;

	@Autowired
	@Qualifier("orderItemRead")
	private OrderItemRead orderItemRead;

	/**
	 * 详情
	 */
	@Override
	public Object detail(Object param) throws DzcxException {
		DetailOrderBo bo = (DetailOrderBo) param;
		Long orderId = bo.getOrderId();
		Object vo = orderRead.detail(orderId);
		return vo;
	}

	/**
	 * 列表
	 */
	@Override
	public Object list(Object param) {
		SearchOrderBo bo = (SearchOrderBo) param;
		Object result = orderRead.list(bo);
		return result;
	}

	/**
	 * 已售列表
	 * @param bo
	 * @return
	 * @throws DzcxException
	 */
	public Object soldList(SearchOrderItemBo bo) throws DzcxException {
		Object result = orderItemRead.soldList(bo);
		return result;
	}
	
	/**
	 * ticket
	 * 列表
	 * @param bo
	 * @return
	 * @throws DzcxException
	 */
	public Object ticketList(SearchOrderBo bo) throws DzcxException {
		Object result = orderItemRead.ticketList(bo);
		return result;
	}

}

